package com.hhq.sso.auth.base.entity;

import java.util.ArrayList;
import java.util.Collection;

import com.hhq.sso.common.entity.BaseEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * Description: some description
 * </p>
 *
 * @author : xiaodong.yang
 * @date : 2024/6/20 10:02
 */
@Data
@TableName("t_user")
@EqualsAndHashCode(callSuper = false)
@Schema(description = "系统用户")
public class SystemUser extends BaseEntity implements UserDetails {

    /**
     * 租户id
     */
    private String tenantId;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 电子邮件
     */
    private String email;

    /**
     * 账户是否超时,设置用户的有效期
     */
    private boolean accountNonExpired;

    /**
     * 账户是否锁定
     */
    private boolean accountNonLocked;

    /**
     * 用户是否有效
     */
    private boolean enabled;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return new ArrayList<>();
    }
}
